//
//  UISlider+Cache.h
//
//  Created by Mark on 15/11/21.
//  Copyright © 2015年 Mark. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol IjkKernelDelegate <NSObject>

@optional
- (void)onPrepared:(NSInteger)videoType;
- (void)onCompletion:(NSInteger)videoType;
- (void)onError:(int)code msg:(NSString *)msg videoType:(NSInteger)videoType;
- (void)onRenderingView:(NSInteger)videoType;
- (void)onBufferStart:(NSInteger)videoType;
- (void)onBufferEnd:(NSInteger)videoType;
- (void)onSeekComplete:(NSInteger)videoType;
- (void)onVideoProcess:(int)process videoType:(NSInteger)videoType;//zhaofei 20210429
@end


@interface KernelConfig : NSObject

@property (nonatomic, assign) BOOL isAutoPlay;
@property (nonatomic, assign) BOOL isLoop;
@property (nonatomic, assign) int process;
@property (nonatomic, strong) NSDictionary *headers;
@property (nonatomic, strong) NSDictionary *options;
@property (nonatomic, assign) int scalingMode;
@property (nonatomic, assign) BOOL isLocalCache;
@property (nonatomic, strong) NSString *localCachePath;
@property (nonatomic, assign) BOOL isLive;
@property (nonatomic, assign) BOOL isMute;

@end

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@interface IjkplayerKernel : UIView

@property (nonatomic, weak) id<IjkKernelDelegate> delegate;

/////////////////////////////公共方法/////////////////////////////
@property (nonatomic, strong) KernelConfig *kernelConfig;
/////////////////////////////end/////////////////////////////
-(void)startVideo:(NSString*)path videoType:(NSInteger)videoType;
-(void)setMute:(BOOL)isMute;
-(void)setVolume:(float)volume;
-(void)setAspectRatio:(int)scalingMode;
-(void)start;
-(void)pause;
-(CGFloat)getDuration;
-(CGFloat)getCurrentPosition;
-(CGFloat)getBufferPosition;
-(void)setSpeed:(float)playSpeed;
-(void)seekTo:(int)msec;
-(long)getTcpSpeed;
-(float)getSpeed;
-(BOOL)isPlaying;
-(BOOL)isCompleted;
-(void)stopPlayback;
-(NSDictionary*)getMediaMetaInfo;
-(void)takeSnapshot:(void(^)(UIImage* image))completion;
@end
